<?php


namespace app\app\validate;


use think\Validate;

class Goods extends Validate
{
    //定义验证规则
    protected $rule = [
        'name|惊喜袋名称' => 'require',
        'img|图片url' => 'require',
        'cate_ids|分类' => 'require',
        'price|价格' => 'require',
        'old_price|原价' => 'require',
        'inventory|库存' => 'require',
        'is_ming|是否明日预售' => 'require',

        'qu_time_start|取货时间开始' => 'require',
        'qu_time_end|取货结束时间' => 'require',
        'purchase_time_start|可购买时间1' => 'require',
        'purchase_time_end|可购买时间2' => 'require',

        //整改一个
        'qu_time|取货时间' => 'require',
        'purchase_time|可购买时间' => 'require',


        'qu_time_start_ming|明日开始取货时间' => 'require',
        'qu_time_end_ming|明日结束取货时间' => 'require',
        'purchase_time_start_ming|明日开始可购买时间' => 'require',
        'purchase_time_end_ming|明日结束可购买时间' => 'require',

        //整改时间2
        'qu_time_ming|取货时间' => 'require',
        'purchase_time_ming|可购买时间' => 'require',

    ];
    //定义验证场景
    protected $scene = [
        'insert' => [
            'name',
            'img',
            'cate_ids',
            'price',
            'old_price',
            'inventory',
            'qu_time',
            'purchase_time',
        ],

        'update_tomorrow' => [
            'inventory_ming',
            'qu_time_ming',
            'purchase_time_ming',
        ],
        'edit' => [
            'price',
            'old_price',
            'inventory',
            'is_ming',
            'qu_time',
            'purchase_time',
//            'qu_time_start_ming',
//            'qu_time_end_ming',
//            'purchase_time_start_ming',
//            'purchase_time_end_ming',
        ],


    ];

}